home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / p_man / cat3 / B.Z / B
Encoding:
Text File  |  1998-10-28  |  13.2 KB  |  661 lines

  1.  
  2.  
  3.  
  4.      BBBB((((3333))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))          BBBB((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       B - The Perl Compiler
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           use B;
  13.  
  14.  
  15.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.       The B    module supplies    classes    which allow a Perl program to
  17.       delve    into its own innards. It is the    module used to
  18.       implement the    "backends" of the Perl compiler. Usage of the
  19.       compiler does    not require knowledge of this module: see the
  20.       _O module for the user-visible    part. The B module is of use
  21.       to those who want to write new compiler backends. This
  22.       documentation    assumes    that the reader    knows a    fair amount
  23.       about    perl's internals including such    things as SVs, OPs and
  24.       the internal symbol table and    syntax tree of a program.
  25.  
  26.      OOOOVVVVEEEERRRRVVVVIIIIEEEEWWWW OOOOFFFF CCCCLLLLAAAASSSSSSSSEEEESSSS
  27.       The C    structures used    by Perl's internals to hold SV and OP
  28.       information (PVIV, AV, HV, ..., OP, SVOP, UNOP, ...) are
  29.       modelled on a    class hierarchy    and the    B module gives access
  30.       to them via a    true object hierarchy. Structure fields    which
  31.       point    to other objects (whether types    of SV or types of OP)
  32.       are represented by the B module as Perl objects of the
  33.       appropriate class. The bulk of the B module is the methods
  34.       for accessing    fields of these    structures. Note that all
  35.       access is read-only: you cannot modify the internals by
  36.       using    this module.
  37.  
  38.       SSSSVVVV----RRRREEEELLLLAAAATTTTEEEEDDDD CCCCLLLLAAAASSSSSSSSEEEESSSS
  39.  
  40.       B::IV, B::NV,    B::RV, B::PV, B::PVIV, B::PVNV,    B::PVMG,
  41.       B::BM, B::PVLV, B::AV, B::HV,    B::CV, B::GV, B::FM, B::IO.
  42.       These    classes    correspond in the obvious way to the
  43.       underlying C structures of similar names. The    inheritance
  44.       hierarchy mimics the underlying C "inheritance". Access
  45.       methods correspond to    the underlying C macros    for field
  46.       access, usually with the leading "class indication" prefix
  47.       removed (Sv, Av, Hv, ...). The leading prefix    is only    left
  48.       in cases where its removal would cause a clash in method
  49.       name.    For example, GvREFCNT stays as-is since    its
  50.       abbreviation would clash with    the "superclass" method    REFCNT
  51.       (corresponding to the    C function SvREFCNT).
  52.  
  53.       BBBB::::::::SSSSVVVV    MMMMEEEETTTTHHHHOOOODDDDSSSS
  54.  
  55.       REFCNT
  56.  
  57.       FLAGS
  58.  
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      BBBB((((3333))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))          BBBB((((3333))))
  71.  
  72.  
  73.  
  74.       BBBB::::::::IIIIVVVV    MMMMEEEETTTTHHHHOOOODDDDSSSS
  75.  
  76.       IV
  77.  
  78.       IVX
  79.  
  80.       needs64bits
  81.  
  82.       packiv
  83.  
  84.       BBBB::::::::NNNNVVVV    MMMMEEEETTTTHHHHOOOODDDDSSSS
  85.  
  86.       NV
  87.  
  88.       NVX
  89.  
  90.       BBBB::::::::RRRRVVVV    MMMMEEEETTTTHHHHOOOODDDDSSSS
  91.  
  92.       RV
  93.  
  94.       BBBB::::::::PPPPVVVV    MMMMEEEETTTTHHHHOOOODDDDSSSS
  95.  
  96.       PV
  97.  
  98.       BBBB::::::::PPPPVVVVMMMMGGGG MMMMEEEETTTTHHHHOOOODDDDSSSS
  99.  
  100.       MAGIC
  101.  
  102.       SvSTASH
  103.  
  104.       BBBB::::::::MMMMAAAAGGGGIIIICCCC MMMMEEEETTTTHHHHOOOODDDDSSSS
  105.  
  106.       MOREMAGIC
  107.  
  108.       PRIVATE
  109.  
  110.       TYPE
  111.  
  112.       FLAGS
  113.  
  114.       OBJ
  115.  
  116.       PTR
  117.  
  118.       BBBB::::::::PPPPVVVVLLLLVVVV MMMMEEEETTTTHHHHOOOODDDDSSSS
  119.  
  120.       TARGOFF
  121.  
  122.       TARGLEN
  123.  
  124.       TYPE
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                        (printed 10/23/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      BBBB((((3333))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))          BBBB((((3333))))
  137.  
  138.  
  139.  
  140.       TARG
  141.  
  142.       BBBB::::::::BBBBMMMM    MMMMEEEETTTTHHHHOOOODDDDSSSS
  143.  
  144.       USEFUL
  145.  
  146.       PREVIOUS
  147.  
  148.       RARE
  149.  
  150.       TABLE
  151.  
  152.       BBBB::::::::GGGGVVVV    MMMMEEEETTTTHHHHOOOODDDDSSSS
  153.  
  154.       NAME
  155.  
  156.       STASH
  157.  
  158.       SV
  159.  
  160.       IO
  161.  
  162.       FORM
  163.  
  164.       AV
  165.  
  166.       HV
  167.  
  168.       EGV
  169.  
  170.       CV
  171.  
  172.       CVGEN
  173.  
  174.       LINE
  175.  
  176.       FILEGV
  177.  
  178.       GvREFCNT
  179.  
  180.       FLAGS
  181.  
  182.       BBBB::::::::IIIIOOOO    MMMMEEEETTTTHHHHOOOODDDDSSSS
  183.  
  184.       LINES
  185.  
  186.       PAGE
  187.  
  188.       PAGE_LEN
  189.  
  190.       LINES_LEFT
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                        (printed 10/23/98)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      BBBB((((3333))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))          BBBB((((3333))))
  203.  
  204.  
  205.  
  206.       TOP_NAME
  207.  
  208.       TOP_GV
  209.  
  210.       FMT_NAME
  211.  
  212.       FMT_GV
  213.  
  214.       BOTTOM_NAME
  215.  
  216.       BOTTOM_GV
  217.  
  218.       SUBPROCESS
  219.  
  220.       IoTYPE
  221.  
  222.       IoFLAGS
  223.  
  224.       BBBB::::::::AAAAVVVV    MMMMEEEETTTTHHHHOOOODDDDSSSS
  225.  
  226.       FILL
  227.  
  228.       MAX
  229.  
  230.       OFF
  231.  
  232.       ARRAY
  233.  
  234.       AvFLAGS
  235.  
  236.       BBBB::::::::CCCCVVVV    MMMMEEEETTTTHHHHOOOODDDDSSSS
  237.  
  238.       STASH
  239.  
  240.       START
  241.  
  242.       ROOT
  243.  
  244.       GV
  245.  
  246.       FILEGV
  247.  
  248.       DEPTH
  249.  
  250.       PADLIST
  251.  
  252.       OUTSIDE
  253.  
  254.       XSUB
  255.  
  256.       XSUBANY
  257.  
  258.  
  259.  
  260.  
  261.      Page 4                        (printed 10/23/98)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      BBBB((((3333))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))          BBBB((((3333))))
  269.  
  270.  
  271.  
  272.       BBBB::::::::HHHHVVVV    MMMMEEEETTTTHHHHOOOODDDDSSSS
  273.  
  274.       FILL
  275.  
  276.       MAX
  277.  
  278.       KEYS
  279.  
  280.       RITER
  281.  
  282.       NAME
  283.  
  284.       PMROOT
  285.  
  286.       ARRAY
  287.  
  288.       OOOOPPPP----RRRREEEELLLLAAAATTTTEEEEDDDD CCCCLLLLAAAASSSSSSSSEEEESSSS
  289.  
  290.       B::OP, B::UNOP, B::BINOP, B::LOGOP, B::CONDOP, B::LISTOP,
  291.       B::PMOP, B::SVOP, B::GVOP, B::PVOP, B::CVOP, B::LOOP,
  292.       B::COP.  These classes correspond in the obvious way to the
  293.       underlying C structures of similar names. The    inheritance
  294.       hierarchy mimics the underlying C "inheritance". Access
  295.       methods correspond to    the underlying C structre field    names,
  296.       with the leading "class indication" prefix removed (op_).
  297.  
  298.       BBBB::::::::OOOOPPPP    MMMMEEEETTTTHHHHOOOODDDDSSSS
  299.  
  300.       next
  301.  
  302.       sibling
  303.  
  304.       ppaddr
  305.           This returns the function    name as    a string (e.g. pp_add,
  306.           pp_rv2av).
  307.  
  308.       desc
  309.           This returns the op description from the global C
  310.           op_desc array (e.g. "addition" "array deref").
  311.  
  312.       targ
  313.  
  314.       type
  315.  
  316.       seq
  317.  
  318.       flags
  319.  
  320.       private
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.      Page 5                        (printed 10/23/98)
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.      BBBB((((3333))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))          BBBB((((3333))))
  335.  
  336.  
  337.  
  338.       BBBB::::::::UUUUNNNNOOOOPPPP MMMMEEEETTTTHHHHOOOODDDD
  339.  
  340.       first
  341.  
  342.       BBBB::::::::BBBBIIIINNNNOOOOPPPP MMMMEEEETTTTHHHHOOOODDDD
  343.  
  344.       last
  345.  
  346.       BBBB::::::::LLLLOOOOGGGGOOOOPPPP MMMMEEEETTTTHHHHOOOODDDD
  347.  
  348.       other
  349.  
  350.       BBBB::::::::CCCCOOOONNNNDDDDOOOOPPPP MMMMEEEETTTTHHHHOOOODDDDSSSS
  351.  
  352.       true
  353.  
  354.       false
  355.  
  356.       BBBB::::::::LLLLIIIISSSSTTTTOOOOPPPP MMMMEEEETTTTHHHHOOOODDDD
  357.  
  358.       children
  359.  
  360.       BBBB::::::::PPPPMMMMOOOOPPPP MMMMEEEETTTTHHHHOOOODDDDSSSS
  361.  
  362.       pmreplroot
  363.  
  364.       pmreplstart
  365.  
  366.       pmnext
  367.  
  368.       pmregexp
  369.  
  370.       pmflags
  371.  
  372.       pmpermflags
  373.  
  374.       precomp
  375.  
  376.       BBBB::::::::SSSSVVVVOOOOPPPP MMMMEEEETTTTHHHHOOOODDDD
  377.  
  378.       sv
  379.  
  380.       BBBB::::::::GGGGVVVVOOOOPPPP MMMMEEEETTTTHHHHOOOODDDD
  381.  
  382.       gv
  383.  
  384.       BBBB::::::::PPPPVVVVOOOOPPPP MMMMEEEETTTTHHHHOOOODDDD
  385.  
  386.       pv
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.      Page 6                        (printed 10/23/98)
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.      BBBB((((3333))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))          BBBB((((3333))))
  401.  
  402.  
  403.  
  404.       BBBB::::::::LLLLOOOOOOOOPPPP MMMMEEEETTTTHHHHOOOODDDDSSSS
  405.  
  406.       redoop
  407.  
  408.       nextop
  409.  
  410.       lastop
  411.  
  412.       BBBB::::::::CCCCOOOOPPPP MMMMEEEETTTTHHHHOOOODDDDSSSS
  413.  
  414.       label
  415.  
  416.       stash
  417.  
  418.       filegv
  419.  
  420.       cop_seq
  421.  
  422.       arybase
  423.  
  424.       line
  425.  
  426.      FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS EEEEXXXXPPPPOOOORRRRTTTTEEEEDDDD    BBBBYYYY BBBB
  427.       The B    module exports a variety of functions: some are    simple
  428.       utility functions, others provide a Perl program with    a way
  429.       to get an initial "handle" on    an internal object.
  430.  
  431.       main_cv
  432.           Return the (faked) CV corresponding to the main part of
  433.           the Perl program.
  434.  
  435.       main_root
  436.           Returns the root op (i.e.    an object in the appropriate
  437.           B::OP-derived class) of the main part of the Perl
  438.           program.
  439.  
  440.       main_start
  441.           Returns the starting op of the main part of the Perl
  442.           program.
  443.  
  444.       comppadlist
  445.           Returns the AV object (i.e. in class B::AV) of the
  446.           global comppadlist.
  447.  
  448.       sv_undef
  449.           Returns the SV object corresponding to the C variable
  450.           sv_undef.
  451.  
  452.       sv_yes
  453.           Returns the SV object corresponding to the C variable
  454.           sv_yes.
  455.  
  456.  
  457.  
  458.  
  459.      Page 7                        (printed 10/23/98)
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.      BBBB((((3333))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))          BBBB((((3333))))
  467.  
  468.  
  469.  
  470.       sv_no
  471.           Returns the SV object corresponding to the C variable
  472.           sv_no.
  473.  
  474.       walkoptree(OP, METHOD)
  475.           Does a tree-walk of the syntax tree based    at OP and
  476.           calls METHOD on each op it visits. Each node is visited
  477.           before its children. If walkoptree_debug (q.v.) has been
  478.           called to    turn debugging on then the method
  479.           walkoptree_debug is called on each op before METHOD is
  480.           called.
  481.  
  482.       walkoptree_debug(DEBUG)
  483.           Returns the current debugging flag for walkoptree. If
  484.           the optional DEBUG argument is non-zero, it sets the
  485.           debugging    flag to    that. See the description of
  486.           walkoptree above for what    the debugging flag does.
  487.  
  488.       walksymtable(SYMREF, METHOD, RECURSE)
  489.           Walk the symbol table starting at    SYMREF and call    METHOD
  490.           on each symbol visited. When the walk reached package
  491.           symbols "Foo::" it invokes RECURSE and only recurses
  492.           into the package if that sub returns true.
  493.  
  494.       svref_2object(SV)
  495.           Takes any    Perl variable and turns    it into    an object in
  496.           the appropriate B::OP-derived or B::SV-derived class.
  497.           Apart from functions such    as main_root, this is the
  498.           primary way to get an initial "handle" on    a internal
  499.           perl data    structure which    can then be followed with the
  500.           other access methods.
  501.  
  502.       ppname(OPNUM)
  503.           Return the PP function name (e.g.    "pp_add") of op    number
  504.           OPNUM.
  505.  
  506.       hash(STR)
  507.           Returns a    string in the form "0x..." representing    the
  508.           value of the internal hash function used by perl on
  509.           string STR.
  510.  
  511.       cast_I32(I)
  512.           Casts I to the internal I32 type used by that perl.
  513.  
  514.       minus_c
  515.           Does the equivalent of the -c command-line option.
  516.           Obviously, this is only useful in    a BEGIN    block or else
  517.           the flag is set too late.
  518.  
  519.       cstring(STR)
  520.           Returns a    double-quote-surrounded    escaped    version    of STR
  521.           which can    be used    as a string in C source    code.
  522.  
  523.  
  524.  
  525.      Page 8                        (printed 10/23/98)
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.      BBBB((((3333))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))          BBBB((((3333))))
  533.  
  534.  
  535.  
  536.       class(OBJ)
  537.           Returns the class    of an object without the part of the
  538.           classname    preceding the first "::". This is used to turn
  539.           "B::UNOP"    into "UNOP" for    example.
  540.  
  541.       threadsv_names
  542.           In a perl    compiled for threads, this returns a list of
  543.           the special per-thread threadsv variables.
  544.  
  545.       byteload_fh(FILEHANDLE)
  546.           Load the contents    of FILEHANDLE as bytecode. See
  547.           documentation for    the BBBByyyytttteeeeccccooooddddeeee module in _B::_B_a_c_k_e_n_d for
  548.           how to generate bytecode.
  549.  
  550.      AAAAUUUUTTTTHHHHOOOORRRR
  551.       Malcolm Beattie, mbeattie@sable.ox.ac.uk
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.      Page 9                        (printed 10/23/98)
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.      BBBB((((3333))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))          BBBB((((3333))))
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.      Page 10                        (printed 10/23/98)
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.